import {
  getListPage as getInvoiceList
} from '@/api/invoice'
import {
  Echartser
} from '@/layout/components'
export default {
  components: {
    Echartser
  },
  data() {
    return {
      listLoading: false,
      empty_text: '数据正在加载中',
      invoiceHots: [],
      invoiceParam: {
        pageNum: 1,
        pageSize: 10
      }
    }
  },
  created() {
    this._fetchData()
  },
  methods: {
    _fetchData() {
      this.getInvoiceList()
    },
    getInvoiceList() {
      // this.listLoading = true
      getInvoiceList(this.invoiceParam).then(response => {
        this.invoiceHots = response.result.list
      })
    },
    statusFilter(status) {
      const statusMap = ['', '待审核', '已驳回', '已通过', '已寄出']
      return statusMap[status]
    },
    detailRow(row) {
      this.$router.push({
        path: '/invoice/detail',
        query: {
          id: row.id
        }
      })
    }
  }
}
